
set(BUILDROOT_HOST_DIR /home/celticzy/nuvoton/nuc980_bsp5/buildroot/output/host)
list(APPEND CMAKE_MODULE_PATH ${BUILDROOT_HOST_DIR}/share/buildroot)

set(CMAKE_SYSTEM_NAME Buildroot)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR armv5l)

set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Debug CFLAGS")
set(CMAKE_C_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CFLAGS")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Buildroot build configuration")

set(CMAKE_C_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Os -g0 -D_FORTIFY_SOURCE=1" CACHE STRING "Buildroot CFLAGS")
set(CMAKE_EXE_LINKER_FLAGS "-Wall" CACHE STRING "Buildroot LDFLAGS for executables")
set(CMAKE_SHARED_LINKER_FLAGS "-Wall" CACHE STRING "Buildroot LDFLAGS for shared libraries")
set(CMAKE_MODULE_LINKER_FLAGS "-Wall" CACHE STRING "Buildroot LDFLAGS for module libraries")

set(CMAKE_INSTALL_SO_NO_EXE 0)

set(CMAKE_PROGRAM_PATH "${BUILDROOT_HOST_DIR}/bin")
set(CMAKE_SYSROOT "${BUILDROOT_HOST_DIR}/arm-nuvoton-linux-gnueabi/sysroot")
set(CMAKE_FIND_ROOT_PATH "${BUILDROOT_HOST_DIR}/arm-nuvoton-linux-gnueabi/sysroot")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(ENV{PKG_CONFIG_SYSROOT_DIR} "${BUILDROOT_HOST_DIR}/arm-nuvoton-linux-gnueabi/sysroot")

set(CMAKE_C_COMPILER "${BUILDROOT_HOST_DIR}/bin/arm-nuvoton-linux-gnueabi-gcc")
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Debug CXXFLAGS")
set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CXXFLAGS")
set(CMAKE_CXX_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Os -g0 -D_FORTIFY_SOURCE=1" CACHE STRING "Buildroot CXXFLAGS")
set(CMAKE_CXX_COMPILER "${BUILDROOT_HOST_DIR}/bin/arm-nuvoton-linux-gnueabi-g++")

